﻿-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[proc_zzjg_DeleteZzjgCompany]
	(
	@id int	
	)
AS
BEGIN	
    
   --如单位下存在部门，则不能删除
    --DECLARE @Deptment INT
    --SET @Deptment=ISNULL((SELECT COUNT(1) FROM Department d WHERE companyid=(select Companyid from zzjg where id=@id)),0)
    --IF @Deptment>0
    --BEGIN
    --	RETURN
    --END
    
   DELETE FROM ManagementArea WHERE zid=(select bh from zzjg where id=@id)
   DELETE FROM zzjg WHERE id=@id	
END
